<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <%@page isELIgnored="false" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String userid = "";
if (request.getAttribute("userid") != null) {
	userid = request.getAttribute("userid").toString();
}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>档案表</title>
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link id="bootstrap-style" href="<c:url value="/css/bootstrap.min.css"/>" rel="stylesheet">
	<link href="<c:url value="/css/bootstrap-responsive.min.css"/>" rel="stylesheet">
	<link id="base-style" href="<c:url value="/css/style.css"/>" rel="stylesheet">
	<link id="base-style-responsive" href="<c:url value="/css/style-responsive.css"/>" rel="stylesheet">
	<link href="<c:url value="/css/index.css"/>" rel="stylesheet">
	<link rel="shortcut icon" href="<c:url value="/img/favicon.ico"/>">
	<link href="<c:url value="/css/page.css"/>" rel="stylesheet">
	<link rel="stylesheet" type="text/css" href="<c:url value="/css/jquery.datetimepicker.css"/>"/>
	<link href="<c:url value="/css/navuser.css"/>" rel="stylesheet">
	<link href="<c:url value="/css/but.css"/>" rel="stylesheet">
	<script src="<c:url value="/js/jquery-1.9.1.min.js"/>"></script>
	<script src="<c:url value="/js/jquery-migrate-1.0.0.min.js"/>"></script>
	<script type="text/javascript" src="<c:url value="/js/layer/layer.js"/>"></script>
	<script src="<c:url value="/js/laydate/laydate.js"/>"></script>
	<script src="<c:url value="/js/build/jquery.datetimepicker.full.js"/>"></script>
	<script src="<c:url value="/js/orgin.js"/>"></script>
	<script src="<c:url value="/js/filebut.js"/>"></script>
</head>
 <script type="text/javascript">
 function reback(){
     var url='<%=basePath%>user/index';
     parent.$("#mainFrame").attr("src",url);
 }
 function update(){
     var formData = new FormData($("#userform")[0]);
     $.ajax({  
          url: '<%=basePath%>user/update',
          type: 'POST',  
          data: formData,  
          async: false,  
          cache: false,
          contentType: false,  
          processData: false,  
          success: function (result) {
                if("ok"==result){
                    alert("修改员工成功");
                    var url='<%=basePath%>user/index';
                    parent.$("#mainFrame").attr("src",url);
                }else if("no"==result){
                    alert("修改员工失败");
                }
          }
     });
 }
 
function lookimg(path){
    layer.open({
		title: '图片',
       type: 2,
       area: ['800px', '560px'],
       fixed: false, //不固定
       maxmin: true,
       content: '<%=basePath%>user/imgmain?path='+path
     });
}
 function xiugai(id) {
     layer.open({
	   title: '修改人员档案',
       type: 2,
       area: ['800px', '560px'],
       fixed: true, //不固定
       maxmin: true,
       content: '<%=basePath%>user/update?id='+id
     });
 }
 function xinzeng() {
     layer.open({
		title: '新增员工',
       type: 2,
       area: ['800px', '660px'],
       fixed: false, //不固定
       maxmin: true,
       content: '<%=basePath%>user/addUsermain'
     });
 }
 laydate.render({
	  elem: '#graduationtime'
	  ,type: 'date'
	  ,format: 'yyyy-MM-dd'
	});
 laydate.render({
	  elem: '#datebirth'
	  ,type: 'date'
	  ,format: 'yyyy-MM-dd'
	});
 laydate.render({
	  elem: '#endtime'
	  ,type: 'month'
	  ,format: 'yyyy-MM-dd'
	});
 laydate.render({
	  elem: '#starttime'
	  ,type: 'month'
	  ,format: 'yyyy-MM-dd'
	});
 function ChangeDiv(divId,divName,zDivCount) { 
		for(i=0;i<=zDivCount;i++) 	{ 
			document.getElementById(divName+i).style.display="none"; 
			//将所有的层都隐藏 
		} 
		document.getElementById(divName+divId).style.display="block"; 
		//显示当前层 
}
 
 </script>
<body>
	<jsp:useBean id="myDate" class="java.util.Date"/> 
			
			<input type="hidden" id="dept" name="dept" value="${dept}"> 
			<div id="content" class="span10" style="width: 82%;background-color:#F9F9F9;">
				<div style="background-color:#FFF;">
				<div style="margin-top:-10px;margin-top:-10px;margin-bottom:20px;margin-left:20px;margin-right:20px;padding-top:20px;">
					<span style="color:#37c2c2">查看员工</span><button style="float:right;" class="but butreturn" type="button" id="select" onclick="reback();">返回</button>
				</div>
				<form name="userform" id="userform">
				
				<div style="margin-left:20px;">
					      员工工号：<span>${user.jobnumber }</span>
				</div>
				<div id="nav">
					<ul style="width: 100%;">
						<li><a onclick="JavaScript:ChangeDiv('0','JKDiv_',5)" style="cursor:hand;">员工基本信息</a> </li>
						<li><a onclick="JavaScript:ChangeDiv('1','JKDiv_',5)" style="cursor:hand;">资料上传</a> </li>
						<li><a onclick="JavaScript:ChangeDiv('2','JKDiv_',5)" style="cursor:hand;">员工学历信息</a> </li>
						<li><a onclick="JavaScript:ChangeDiv('3','JKDiv_',5)" style="cursor:hand;">员工工作经历</a> </li>
						<li><a onclick="JavaScript:ChangeDiv('4','JKDiv_',5)" style="cursor:hand;">员工紧急联系人信息</a></li>
						<li><a onclick="JavaScript:ChangeDiv('5','JKDiv_',5)" style="cursor:hand;">员工私密信息</a> </li>
					</ul>
					<div style="clear:both"></div>
				</div>
					<input type="hidden" id="userid" name="userid" value="${user.id}">
					<div id="JKDiv_0" style="font-size:14px;margin:20px;">
						<div>
							<div style="width:33%;float:left;">
								<span>姓名：</span>
								<span>${user.name}</span>
							</div>
							<div style="width:33%;float:left;">
								<span>性别：</span>
								<span>
									<c:if test="${user.sex == 1}">
										男
									</c:if>
									<c:if test="${user.sex == 2}">
										女
									</c:if>
								</span>
							</div>
							<div style="width:33%;float:left;">
								<span>出生日期：</span>
								<span>${datebirth}</span>
							</div>
						</div>
						<div>
							<div style="width:33%;float:left;">
								<span>籍贯：</span>
								<span>${user.origin}</span>
							</div>
							<div style="width:33%;float:left;">
								<span>民族：</span>
								<span>${user.nation}</span>
							</div>
							<div style="width:33%;float:left;">
								<span>政治面貌：</span>
								<span>${user.politicalstatus}</span>
							</div>
						</div>
						<div>
							<div style="width:33%;float:left;">
								<span>语言：</span>
								<c:forEach items="${languageArr}" var="lang">
									<span>
										<c:if test="${lang == 1}">普通话</c:if>
										<c:if test="${lang == 2}">英语</c:if>
										<c:if test="${lang == 3}">粤语</c:if>
										<c:if test="${lang == 4}">其他</c:if>
									</span>
								</c:forEach>
							</div>
							<div style="width:33%;float:left;">
								<span>特长：</span>
								<span>${user.speciality}</span>
							</div>
							<div style="width:33%;float:left;">
								<span>最高学历：</span>
								<span>${user.highesteducation}</span>
							</div>
						</div>
						<div>
							<div style="width:33%;float:left;">
								<span>专业：</span>
								<span>${user.professional}</span>
							</div>
							<div style="width:33%;float:left;">
								<span>身份证号码：</span>
								<span>${user.idcard}</span>
							</div>
							<div style="width:33%;float:left;">
								<span>婚姻情况：</span>
								<span>
									<c:if test="${user.maritalstatus == 1}">已婚</c:if>
									<c:if test="${user.maritalstatus == 2}">未婚</c:if>
								</span>
							</div>
						</div>
						<div>
							<div style="width:33%;float:left;">
								<span>身高：</span>
								<span>${user.height }</span>
							</div>
							<div style="width:33%;float:left;">
								<span>体重：</span>
								<span>${user.weight }</span>
							</div>
							<div style="width:33%;float:left;">
								<span>视力：</span>
								<span>${user.vision }</span>
							</div>
						</div>
						<div>
							<div style="width:33%;float:left;">
								<span>手机：</span>
								<span>${user.mobile }</span>
							</div>
							<div style="width:33%;float:left;">
								<span>QQ号码：</span>
								<span>${user.qq }</span>
							</div>
							<div style="width:33%;float:left;">
								<span>E-email地址：</span>
								<span>${user.mail }</span>
							</div>
						</div>
						<div>
							<div style="width:33%;float:left;">
								<span>微信号：</span>
								<span>${user.weixinid }</span>
							</div>
							<div style="width:33%;float:left;">
								<span>户口所在地：</span>
								<span>${user.birthplace }</span>
							</div>
							<div style="width:33%;float:left;">
								<span>现居住地址：</span>
								<span>${user.address }</span>
							</div>
						</div>
						<div>
							<div style="width:33%;float:left;">
								<span>推荐人：</span>
								<span>${user.referee }</span>
							</div>
							<div style="width:33%;float:left;">
								<span>能否接受外派：</span>
								<span>
									<c:if test="${user.ifsend == 1}">能</c:if>
									<c:if test="${user.ifsend == 2}">否</c:if>
								</span>
							</div>
							<div style="width:33%;float:left;">
								<span>外派地区：</span>
								<span>${user.sendaddress }</span>
							</div>
						</div>
					</div>
				<div id="JKDiv_1" style="display:none;font-size:14px;margin:10px;">
								<c:forEach items="${user.scanlist}" var="userScan">
						<div>
							<div style="width:22%;float:left;">
								<span>资料上传：</span> 
									<span>
									<c:if test="${userScan.type == ''}">请选择</c:if>
									<c:if test="${userScan.type == 1}">员工登记表</c:if>
									<c:if test="${userScan.type == 2}">入职简历</c:if>
									<c:if test="${userScan.type == 3}">入职体检表</c:if>
									<c:if test="${userScan.type == 4}">身份证</c:if>
									<c:if test="${userScan.type == 5}">学历</c:if>
									<c:if test="${userScan.type == 6}">合同</c:if>
									<c:if test="${userScan.type == 7}">上家公司离职证明</c:if>
									<c:if test="${userScan.type == 8}">离职证明审批</c:if>
									<c:if test="${userScan.type == 9}">离职证明</c:if>
                                    <c:if test="${userScan.type == 10}">面试记录</c:if>
									<c:if test="${userScan.type == 11}">银行卡</c:if>
									</span>
							</div>
							<div style="width:22%;float:left;">
								<c:if test="${userScan.path != '' && userScan.path !=null}">
									<a onclick="lookimg('${userScan.path }')">查看</a>
								</c:if>
							</div>
							<div style="width:33%;float:left;">
							</div>
						</div>
						</c:forEach>
				</div> 
				<div id="JKDiv_2" style="display:none;font-size:14px;margin:10px;">
					<c:forEach items="${user.educationlist }" var="userEducation">
						<div>
						<div style="width:33%;float:left;">
							<span>毕业时间：</span>
							<span>
								<c:if test="${userEducation.graduationtime != null}">
									<c:set target="${myDate}" property="time" value="${userEducation.graduationtime }"/> 
									<fmt:formatDate pattern="yyyy-MM-dd" value="${myDate}" type="both"/> 
								</c:if>
							</span>
						</div>
						<div style="width:33%;float:left;">
							<span>毕业院校：</span>
							<span>${userEducation.universitie }</span>
						</div>
						<div style="width:33%;float:left;">
							<span>毕业专业：</span>
							<span>${userEducation.major }</span>
						</div>
					</div>
					<div>
						<div style="width:33%;float:left;">
							<span>毕业证书编号：</span>
							<span>${userEducation.educationNum }</span>
						</div>
						<div style="width:65%;float:left;">
							<span>照片：</span>
							<c:if test="${userEducation.educationPath != '' && userEducation.educationPath !=null}">
								<a onclick="lookimg('${userEducation.educationPath}')">查看</a>
							</c:if>
						</div>
					</div>
					<div>
						<div style="width:33%;float:left;">
							<span>学位证书编号：</span>
							<span>${userEducation.academicdegreeNum }</span>
						</div>
						<div style="width:65%;float:left;">
							<span>照片：</span>
							<c:if test="${userEducation.academicdegreePath != '' && userEducation.academicdegreePath !=null}">
								<a onclick="lookimg('${userEducation.academicdegreePath }');">查看</a>
							</c:if>
						</div>
					</div>
					</c:forEach>
				</div> 
				<div id="JKDiv_3" style="display:none;font-size:14px;margin:10px;">
						<c:forEach items="${user.userWorkexperiencelist}" var="userWorkexperience">
							<div>
							<div style="width:33%;float:left;">
								<span>起止年月：</span>
								<span>${userWorkexperience.starttimeString }</span>-
								<span>${userWorkexperience.endtimeString }</span>
							</div>
							<div style="width:33%;float:left;">
								<span>所在单位：</span>
								<span>${userWorkexperience.unitname }</span>
							</div>
							<div style="width:33%;float:left;">
								<span>部门/职务：</span>
								<span>${userWorkexperience.positions }</span>
							</div>
						</div>
						<div>
							<div style="width:33%;float:left;">
								<span>薪资：</span>
								<span>${userWorkexperience.salary }</span>
							</div>
							<div style="width:33%;float:left;">
								<span>证明人：</span>
								<span>${userWorkexperience.witness }</span>
							</div>
							<div style="width:33%;float:left;">
								<span>联系电话(必填)：</span>
								<span>${userWorkexperience.mobile }</span>
							</div>
						</div>
						</c:forEach>
				</div> 
				<div id="JKDiv_4" style="display:none;font-size:14px;margin:10px;">
						<c:forEach items="${user.userEmergencycontactlist}" var="userEmergencycontact">
							<div>
							<div style="width:33%;float:left;">
								<span>姓名：</span>
								<span>${userEmergencycontact.name }</span>
							</div>
							<div style="width:33%;float:left;">
								<span>与本人关系：</span>
								<span>${userEmergencycontact.relationship }</span>
							</div>
							<div style="width:33%;float:left;">
								<span>联系电话(必填)：</span>
								<span>${userEmergencycontact.mobile }</span>
							</div>
						</div>
						<div>
							<div style="width:33%;float:left;">
								<span>年龄：</span>
								<span>${userEmergencycontact.age }</span>
							</div>
							<div style="width:33%;float:left;">
								<span>工作单位/职务：</span>
								<span>${userEmergencycontact.positions }</span>
							</div>
						</div>						
						</c:forEach>
				</div> 
				<div id="JKDiv_5" style="display:none;font-size:14px;margin:10px;">
					<div>
						<div style="width:33%;float:left;">
							<span>工资卡银行：</span>
							<span>${user.userPrivate.bankname }</span>
						</div>
						<div style="width:33%;float:left;">
							<span>工资卡号：</span>
							<span>${user.userPrivate.bankcardno }</span>
						</div>
						<div style="width:33%;float:left;">
							
							<c:if test="${user.userPrivate.bankpath != '' && user.userPrivate.bankpath !=null}">
								<span>照片</span><a onclick="lookimg('${user.userPrivate.bankpath}');">查看</a>
							</c:if>
						</div>
					</div>
					<div>
						<div style="width:33%;float:left;">
							<span>社保号：</span>
							<span>${user.userPrivate.securityno }</span>
						</div>
						<div style="width:33%;float:left;">
							<span>公积金：</span>
							<span>${user.userPrivate.accumulationno }</span>
						</div>
					</div>
				</div> 
				</form>
				<div class="row-fluid content-table">
					<table class="table  bootstrap-datatable" style=" border:none; border-spacing:0; border-collapse:collapse;margin:0;padding:0">
					  <tbody>
						<tr class="content-search" style="text-align: center;">
							<td colspan="6">
								
							</td>
						</tr>
					  </tbody>
				  </table>            
				</div>
			</div>
		</div>
</body>
</html>
